﻿<?php //Seyret Component v.0.3//
/**
* @package Seyret
* @version 0.3
* @copyright Copyright (C) 2008 Mustafa DINDAR. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Seyret Video Component is a free software.
* See seyrettos.html for license notices and details.
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );


$document = & JFactory::getDocument();

$jslink=JURI :: root()."components/com_seyret/includes/js/jquery-ui-1.7.2.custom.min.js";
$document->addScript($jslink);

echo $this->toolbar;
echo $this->modtoolbar;


?>


<div>


	<div>
		<div  style="float:right;">
			<?php
			
				//create switch button here
				if ($this->channelvldisplay=="oc") {
				?>
				<a href="<?php echo $this->absURL("index.php?option=com_seyret&view=channel&task=videos&id=".$this->chid."&chvld=multi");?>">
					<img src="<?php echo JURI::root()."components/com_seyret/themes/default/images/switchmulti.png";?>" alt="" />
				</a>
				
				<?php
				
				} else {
				?>
				<a href="<?php echo $this->absURL("index.php?option=com_seyret&view=channel&task=videos&id=".$this->chid."&chvld=oc");?>">
					<img src="<?php echo JURI::root()."components/com_seyret/themes/default/images/switchoc.png";?>" alt="" />
				</a>
				
				<?php							
				}
			
			?>

		</div>
		<div style="clear:both;"></div>
	</div>


		
	<?php

	//generate one column view
	if ($this->channelvldisplay == "oc") {
	
		foreach ($this->channelvideoslist as $chvideo) {
		
			$safevideotitle = str_replace("'", "\'", $chvideo->videotitle);
			$safevideotitle = str_replace("\"", "&quot;", $safevideotitle);				
		
			$inql = false;
			if (in_array($chvideo->id, $this->quicklistarray)) {
				$inql = true;			
			}

		?>
		
		<div class="listedvideolistvideooc">
			<div class="listedvideolistinfooc">

				<div class="listedvideolisttitledivoc">
					<a href="<?php echo $chvideo->videolink;?>" style="font-weight:bold;">
						<?php echo $chvideo->videotitle;?>
					</a>
				</div>
				<div class="listedvideolistdescdivoc">
					<?php echo $chvideo->videodescription;?>
				</div>
				<div class="listedvideolistfootdivoc">
					<?php echo JText::_('Added Date');?>: <?php echo $chvideo->addeddate;?>   - <?php echo JText::_('Duration');?>: <?php echo $chvideo->duration;?>
				</div>
				
			</div>
			
			<div class="listedvideolistthumbdivoc">
				<a href="<?php echo $chvideo->videolink;?>">
					<img class="listedvideolistthumbnailoc" src="<?php echo $chvideo->videothumbnail;?>" alt=""/> 
				</a>
				<div id="chvaddtoqlbdiv<?php echo $chvideo->id; ?>" style="margin-top:-22px; padding-left:5px; z-index:9999;">

					<img id="chvaddtoqlimg_js_<?php echo $chvideo->id; ?>" class="addtoquicklistbutton" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/add_ql.png";?>" alt="" onclick="jQuery.seyrettools.addtoquicklist('<?php echo $chvideo->id; ?>', '<?php echo htmlentities($chvideo->videothumbnail);?>', '<?php echo $safevideotitle; ?>', '<?php echo $chvideo->videonojxlink; ?>')" style="visibility:<?php echo ($inql==false)? 'visible' : 'hidden';?>;"/>
					<img id="chvaddtoqlimg_js_rem<?php echo $chvideo->id; ?>" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/added_ql.png";?>" alt="" style="visibility:<?php echo $inql==false ? 'hidden' : 'visible';?>; margin-left:-16px;"/>

				</div>						
			</div>

			<div class="listedvideolistextrasdivoc">

					
					<?php echo $chvideo->useravatar; ?><br/>
					<?php echo $chvideo->usernamelinked; ?>
					<div style="">
						<?php echo $chvideo->votestars; ?>
						<div class="clear"></div>
					</div>
					
					<?php echo JText::_('Views');?> : <?php echo $chvideo->hits; ?>
											
					
				
			</div>					

			
			<div class="clear"></div>
		</div>



		<?php	

		
		}
				
	} else {

		foreach ($this->channelvideoslist as $chvideo) {
		
			$safevideotitle = str_replace("'", "\'", $chvideo->videotitle);
			$safevideotitle = str_replace("\"", "&quot;", $safevideotitle);				
		
			$inql = false;
			if (in_array($chvideo->id, $this->quicklistarray)) {
				$inql = true;			
			}

		?>
		
		<div class="listedvideolistvideomc">
			<div class="backgroundpadding">
				<div class="listedvideolisttitledivmc">
					<a href="<?php echo $chvideo->videolink;?>" style="font-weight:bold;">
						<?php echo $chvideo->videotitle;?>
					</a>
				</div>
			</div>
			
			<div class="backgroundpadding">
				<div class="listedvideolistbodymc">
					<div class="listedvideolistthumbdivmc">
						<a href="<?php echo $chvideo->videolink;?>">
							<img class="listedvideolistthumbnailmc" src="<?php echo $chvideo->videothumbnail;?>" alt=""/> 
						</a>
						<div id="chvaddtoqlbdiv<?php echo $chvideo->id; ?>" class="videolistqlbtnmc">

							<img id="chvaddtoqlimg_js_<?php echo $chvideo->id; ?>" class="addtoquicklistbutton" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/add_ql.png";?>" alt="" onclick="jQuery.seyrettools.addtoquicklist('<?php echo $chvideo->id; ?>', '<?php echo htmlentities($chvideo->videothumbnail);?>', '<?php echo $safevideotitle; ?>', '<?php echo $chvideo->videonojxlink; ?>')" style="visibility:<?php echo ($inql==false)? 'visible' : 'hidden';?>;"/>
							<img id="chvaddtoqlimg_js_rem<?php echo $chvideo->id; ?>" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/added_ql.png";?>" alt="" style="visibility:<?php echo $inql==false ? 'hidden' : 'visible';?>; margin-left:-16px;"/>

						</div>	

						<div class="listedvideolistdurationdivmc"><?php echo $chvideo->duration;?>
						</div>
						
					</div>
					<div style="clear:both;"></div>
					<div class="listedvideolistvotestarsmc">
						<?php echo $chvideo->votestars; ?>
						<div class="clear"></div>
					</div>
					
					<div class="listedvideousernamemc">
						<?php echo $chvideo->usernamelinked; ?>
					</div>
					
					<div class="listedvideoaddeddatemc">
						<?php echo $chvideo->addeddate; ?>
					</div>
					
					<div class="clear"></div>

					<div class="listedvideousernamemc">
						<?php echo JText::_('Views');?>: <?php echo $chvideo->hits; ?>
					</div>
					
					<div class="listedvideoaddeddatemc">
						<?php echo JText::_('Comments');?>: <?php echo $chvideo->commentcount; ?>
					</div>
					
					<div class="clear"></div>

					
				</div>
			</div>
		</div>
		


		<?php	

		
		}			
	
	
	}
	
	
	?>
	
	<div class="clear"></div>
	<div class="paginatordiv">
	
		<?php echo $this->chvlpageNav; ?>
	
	</div>		
				
	<div style="clear:both;"></div>	

</div>

